﻿function checkType() {

    var fileName = document.getElementById("ctl00_rightsidebar_FileUpLoad1").value;

    var seat = fileName.lastIndexOf(".");

    var extension = fileName.substring(seat).toLowerCase();

    var allowed = [".jpg", ".gif", ".png", ".bmp", ".jpeg"];
    for (var i = 0; i < allowed.length; i++) {
        if (!(allowed[i] != extension)) {
            return true;
        }
    }
    alert("不支持" + extension + "格式");
    return false;
}
function ShowUpdate() {
    var upload = document.getElementById("blackpanel");
    var uploaddiv = document.getElementById("uploaddiv");
    upload.style.width = document.documentElement.clientWidth + "px";
    upload.style.height = document.documentElement.clientHeight + "px";
    uploaddiv.style.top = document.documentElement.clientHeight / 2 - 80 + "px";
    uploaddiv.style.left = document.documentElement.clientWidth / 2 - 120 + "px";
    upload.style.display = "block";
}
function Closepanel() {
    var upload = document.getElementById("blackpanel");
    upload.style.display = "none";
}